import scrapy


class RequestParamsSpider(scrapy.Spider):
    name = "request_params"

    async def start(self):
        yield scrapy.Request("http://httpbin.org/get?id=101",cb_kwargs={"age":10},meta={"name":"wang"})

    def parse(self, response,age):
        print(age,response.meta["name"],"-------------------------------")

        response.meta.update({"name": "zhang"})
        # origin = response.json().get("origin")
        # print(origin)
        yield scrapy.FormRequest(url='http://httpbin.org/post',callback=self.parse_leve2,method="POST",cb_kwargs={"age":age},meta=response.meta)


    async def parse_leve2(self, response,age):
        print(age, response.meta, "======================")
        print(response.url)
        print(response.json())

